package oj;

import java.util.ArrayList;
import java.util.Scanner;

public class Day43S {
    static ArrayList<ArrayList<Integer>> res=new ArrayList<>();
    static ArrayList<Integer> list=new ArrayList<>();
    public static void main(String[] args){
        Scanner sc=new Scanner(System.in);
        while(sc.hasNext()){
            int n=sc.nextInt();
            int m=sc.nextInt();
            dfs(1,m,n);
            for(ArrayList<Integer> list2:res){
                int i=0;
                for(;i<list2.size()-1;i++){
                    System.out.print(list2.get(i)+" ");
                }
                System.out.println(list2.get(i));
            }

        }
    }
    private static void dfs(int index,int count,int n){
        if(count==0){
            res.add(new ArrayList<>(list));
        }
        for(int i=index;i<=n&&i<=count;i++){
            list.add(i);
            dfs(i+1,count-i,n);
            list.remove(list.size()-1);
        }
    }
}
